<?php

class KeyValueWorkflowContainer extends AbstractWorkflowContainer
{
  
  /**
   * @var array
   */
  protected $values = array();

  /**
   * @param string $key
   * @param mixed $value
   */
  public function setValue ($key, $value)
  {
    $this->values[$key] = $value;
  }

  /**
   * @param string $key
   * @param mixed $default
   * @return mixed
   */
  public function getValue ($key, $default = null)
  {
    if ($this->hasValue($key))
    {
      return $this->values[$key];
    }
    else
    {
      return $default;
    }
  }

  /**
   * @param string $key
   * @return bool
   */
  public function hasValue ($key)
  {
    return isset($this->values[$key]);
  }

}